-module(test_example).
-export([setup/1,tear_down/1,test/1]).

-behaviour(testcase).

%%
%% 2013-04-27
%% Changed this most simple test example to work with
%% the new test case behaviour, setup and teardown 
%% don't do anything here
setup(_Params) ->
    ok.
    
tear_down(_State) ->
    ok.

test(_State) ->
    RandomString = get_random_string(20,"abcd12344"),
    io:fwrite("\n____" ++ RandomString ++ "____\n").

%% Some strings
get_random_string(Length, AllowedChars) ->
    lists:foldl(fun(_, Acc) ->
                        [lists:nth(random:uniform(length(AllowedChars)),
                                   AllowedChars)]
                            ++ Acc
                end, [], lists:seq(1, Length)).

% A toString function for writing Ints
%to_string(Something) ->
%   case length(Something) of
%      1 -> io_lib:format("~p", Something);
%      _ -> lists:flatten(io_lib:format("~p", [Something]))
%   end.